package thread;

import java.util.Scanner;

public class ThreadDemo20 {
    private volatile static int isQuit = 0;
    public static void main(String[] args) {
        Thread t1 = new Thread(() -> {
            while(isQuit == 0){

            }
            System.out.println("hello t1");
        });

        Thread t2 = new Thread(() -> {
            Scanner in = new Scanner(System.in);
            System.out.println("请输入 isQuit 的值：");
            isQuit = in.nextInt();
        });

        t1.start();
        t2.start();
    }
}
